#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>

bool isPalindrome(char* s)
{
    int len = strlen(s);
    char *p = malloc(sizeof(char)*len);
    int j = 0;
    for(int i = 0; i < len;i++)
    {
        if(s[i] >= 'A' && s[i] <= 'Z')
        {
            p[j++] = s[i] + 32;
        }
        else if(s[i] >= 'a' && s[i] <= 'z')
        {
            p[j++] = s[i];
        }
    }
    p[j] = '\0';
    for(int i = 0;i <= (j - 1) / 2;i++)
    {
        if(p[i] != p[j - 1 - i])
        {
            return false;
        }
    }
    return true;
}


int main()
{
    char s[] = "A man, a plan, a canal: Panama";
    if(isPalindrome(s))
        printf("true\n");
    else
        printf("false\n");
    return 0;
}